Ext.define('Lms.main.LeftMenuPanel',{
	extend : 'Ext.tree.Panel',
	initComponent : function(){
		Ext.apply(this,{
			id : 'leftMenuPanel',
			region : 'west',
			title : LocaleUtil.getMessage('rms.label.menu'),
			width: 185,
	        minSize: 175,
	        maxSize: 175,
			split:true,
//	        collapseMode: 'mini',
	        animCollapse: true,
	    	border : true,    	
	    	rootVisible: false,
	    	lines : false,
//	    	singleExpand : true,
	    	collapsible: true,
	    	store: new Ext.data.TreeStore({
	            proxy: {
	                type: 'ajax',
	                url: 'menu.do'
	            },
	            root: {
	                text: 'Root',
	                expanded: true
	            }
	        })
		});		
		this.callParent(arguments);
		this.on('itemclick', this.chageMenu,this);
	},
	
	chageMenu : function(panel, record, item, index, e, eOpts){
		var panelId = record.raw.panelId;
		if(panelId){
			Ext.getCmp('mainPanel').changeMainPanel(panelId);
		}
	}
});